package com.lean.android.ad.workflow

import android.app.Activity
import androidx.annotation.RestrictTo
import com.lean.android.ad.core.AdLoaders
import com.lean.android.ad.utils.AdLog

@RestrictTo(RestrictTo.Scope.LIBRARY)
class InterstitialNode(
    private val activity: Activity
) : WorkFlowNode {

    override fun enter(workFlow: WorkFlow) {
        AdLog.d(AdLog.AdWorkFlowTag, "InterstitialNode enter.")
        AdLoaders.startInterstitialAd(activity, onAdFinished = {
            exit(workFlow)
        })
    }
}